package com.github.wui.ktEx

import android.view.View
import com.github.wui.utils.time.CountDown
import com.github.wui.utils.time.countDownCallBack
import com.github.wui.utils.time.countDownHint
import java.util.Calendar


/**
 * 处理时间的一些东西
 * @author <a href="https://github.com/karai-oss">Mr.xie</a>
 * @Date 2025/4/23
 */

var weekArr = arrayOf("日", "一", "二", "三", "四", "五", "六")

/**
 * 获取第几周
 */
fun Any.getWeeks(): String {
    val calendar = Calendar.getInstance()
    return weekArr[calendar.get(Calendar.DAY_OF_WEEK) - 1]
}

fun View.countDown(total: Long, interval: Long, finish: countDownCallBack, hit: countDownHint) {
    var countDowner = CountDown(total, interval, finish, hit);
    countDowner.start();
}


fun Any.countDown(total: Long, interval: Long, finish: countDownCallBack, hit: countDownHint) {
    var countDowner = CountDown(total, interval, finish, hit);
    countDowner.start();
}